/**
 * Created by xuchaosheng on 16/7/19.
 */
directives.directive('populHotMap', ["$rootScope", "tools", "$timeout", function ($rootScope, tools, $timeout) {
    return {
        restrict: 'AE',
        scope: {},
        replace: true,
        link: function (scope, element, attr) {
            $(element).find('.content').height(document.documentElement.clientHeight * 0.8);

            $rootScope.$on('POPUL_HOT_MAP_EV', function (e, config) {
                $(element).find('iframe').height(document.documentElement.clientHeight * 0.8 + 100);
                $(element).find('iframe').width(document.documentElement.clientWidth - 100 + 320);
                $(element).find('iframe').attr('width', $(element).width() - 50);
                $(element).modal('show');
            });
            scope.close = function () {
                $(element).modal('hide');
                $rootScope.$broadcast('POPUL_HOT_MAP_OFF_EV');
            }
        },
        templateUrl: "/trend-new-BI/app/components/common/chartManager/map/populHotMap/populHotMap.html"
    }
}]);